package com.yueka.pojo;



import java.io.Serializable;

/**
 * 后端统一返回结果
 */
public class Result {

    public Integer code; //编码：1成功，0为失败
    public String message; //错误信息
    public Object data; //数据

    public static Result success() {
        Result result = new Result();
        result.code = 200;
        result.message = "success";
        return result;
    }

    public static Result success(Object object) {
        Result result = new Result();
        result.data = object;
        result.code = 200;
        result.message = "success";
        return result;
    }

    public static Result error(String msg) {
        Result result = new Result();
        result.message = msg;
        result.code = 500;
        return result;
    }

}
